<?php
class IndexController extends Yaf_Controller_Abstract
{
	const NET_OK = 10; //匹配后台返回值10，为返回成功
	public function init()
	{
		Yaf_Loader::import('import.php');//导入php文件。相对路径在APP_PATH."/library"下加载
	}

	/**
	 * 登录首页
	 * @method indexAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function indexAction()
	{
		$user = cookie::get('user');
		if(!$user){
			$this->redirect('/index/login/');
		}
		
	}
	
	public function loginAction(){
		
	}
	/**
	 * 后台页面初始化
	 * @method backgroundInitAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function backgroundInitAction()
	{
		$user = cookie::get('user');
		if (!$user)
		{
			$this->redirect("/index/");
			return;
		}
		
	}
	/**
	 * 欢迎界面
	 * @method mainWelcomAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function mainWelcomAction()
	{
		
	}
	/**
	 * 修改密码
	 * @method passwordAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function passwordAction()
	{
		$user = cookie::get('user');
		if (!$user)
		{
			$this->redirect("/index/");
			return;
		}
	}
	/**
	 * 注销
	 * @method logoutAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function logoutAction()
	{
		$user = cookie::get('user');
		if (!$user)
		{
			$this->redirect("/index/");
			return;
		}
		cookie::del('user');
		$this->redirect("/index/");
		return false;
	}
}
?>
